import React from 'react';
import { useHistory } from 'umi';
import { Space } from 'antd';
import { LeftCircleTwoTone } from '@ant-design/icons';

import { useBreadcrumb } from '@/hooks/';

import S from './index.less';

export default () => {
  const { breadcrumb } = useBreadcrumb();
  const history = useHistory();

  return breadcrumb ? (
    <div className={S.breadcrumb}>
      <Space size="middle">
        <LeftCircleTwoTone
          style={{ fontSize: 18 }}
          onClick={() => history.goBack()}
        />
        <span style={{ fontSize: 20 }}>
          <b>{breadcrumb}</b>
        </span>
      </Space>
    </div>
  ) : (
    ''
  );
};
